#pragma once

#include "API.h"
#include "Board.h"
#include "IGameStateLoader.h"

namespace snake
{

  namespace encoding
  {
    const wchar_t 
      CHAR_EMPTY            = L' ',
      CHAR_WALL             = L'\u263c',
      CHAR_SNAKE_BODY       = L'\u2558',
      CHAR_SNAKE_HEAD_LEFT  = L'\u25c4',
      CHAR_SNAKE_HEAD_RIGHT = L'\u25ba',
      CHAR_SNAKE_HEAD_UP    = L'\u25b2',
      CHAR_SNAKE_HEAD_DOWN  = L'\u25bc',
      CHAR_FOOD             = L'\u263a',
      CHAR_POO              = L'\u263b';
  }

  /**
    Class GameStateLoader - loads game state from the given message
  */
  class SNAKE_API GameStateLoader
    : public IGameStateLoader
  {
  public:
    GameStateLoader();
    ~GameStateLoader();

    /// Loads the board
    virtual Board LoadBoard(const std::wstring &message) override;

  private:
    // non-copyable
    GameStateLoader(const GameStateLoader &);
    GameStateLoader &operator=(const GameStateLoader &);

  private:
    class Impl;
    Impl *p_impl_;
  };

}